/*************************************************************************
	> File Name: P3910.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-07-09 11:26:49
 ************************************************************************/

#include <iostream>
#include <cmath>
using namespace std;

int main() {
    long long n, m;
    cin >> n >> m;
    m *= 2;
    int max_n = sqrt(m);
    for (long long y = max_n; y >= 1; y--) {
        if (m % y) continue;
        long long x = m / y;
        if ((x - y + 1) % 2) continue;
        long long a = (x - y + 1) / 2, b = (x + y - 1) / 2;
        if (a < 1 || a > n || b < 1 || b > n) continue;
        printf("[%lld,%lld]\n", a, b);
    }
    return 0;
}
